<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../../../../component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">养老机构</label>
                        <div class="layui-input-block">
                            <input type="text" name="personInstitution" value="智能养老院" lay-verify="title" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">老人姓名</label>
                        <div class="layui-input-block">
                            <input type="text" name="patientName" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">入住区域</label>
                        <div class="layui-input-block">
                            <input type="text" name="area" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">入住房间</label>
                        <div class="layui-input-block">
                            <input type="text" name="roomNum" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">床位号</label>
                        <div class="layui-input-block">
                            <input type="text" name="bedNum" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">外出时间</label>
                        <div class="layui-input-block">
                            <input type="date" name="outTime" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">回院时间</label>
                        <div class="layui-input-block">
                            <input type="date" name="returnTime" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">陪同人</label>
                        <div class="layui-input-block">
                            <input type="text" name="accPerson"  value="张三" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">批准人</label>
                        <div class="layui-input-block">
                            <input type="text" name="approveman"  value="张医生" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">外出原因</label>
                        <div class="layui-input-block">
                            <input type="text" name="outreason" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline layui-hide">
                        <label class="layui-form-label"></label>
                        <div class="layui-input-block">
                            <input type="text" name="outstatus" value="外出" lay-verify="required" autocomplete="off" placeholder="请输入" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="village-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="../../../../component/layui/layui.js"></script>
<script src="../../../../component/pear/pear.js"></script>


<script>
layui.use(['form','jquery','upload','dtree'],function(){
    let form = layui.form;
    let $ = layui.jquery;
    let upload = layui.upload;



    form.on('submit(village-save)', function(data){

        //获取隐藏域中的图片
       // data.field.image=$(".image")[0].value;

        console.info(data.field)

        $.ajax({
            url:'http://localhost:8080/goout/add',
            data:data.field,
            type:'post',
            success:function(result){
                if(result.code==0){
                    layer.msg(result.msg,{icon:1,time:1000},function(){
                        parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                        window.parent.location.reload()
                    });
                }else{
                    layer.msg(result.msg,{icon:2,time:1000});
                }
            }
        })
        return false;
    });
})
</script>
<script>
</script>
</body>
</html>
